#include "Pipe.hpp"
#include <cstdio>

int main()
{
    PipeFifo fifo;
    fifo.Build();
    int fd = fifo.OpenFile(WriteOpen);
    std::string s;
    while(1)
    {
        s.clear();
        std::cout << s.size() << std::endl;
        std::cout << "请输入Enter@: ";
        getline(std::cin, s);
        write(fd, s.c_str(), s.size());
        std::cout << std::endl;
    }

    return 0;
}